﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
          "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <script language="javascript" type="text/javascript" async="async" src="/ctr.360kad.com/ctrjs/ctr_v2.js"></script>
    <script language="javascript" type="text/javascript" src="http://res.360kad.com/script/envconfig.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>用户注册</title>
    <script src="https://res.360kad.com/script/jquery.1.7.1.min.js" type="text/javascript"></script>
    <link href="https://res.360kad.com/theme/user/css/base.css" rel="stylesheet" type="text/css">
    <link href="https://res.360kad.com/theme/user/css/pcLogin.css" rel="stylesheet" type="text/css">
    
    <script src="https://res.360kad.com/script/jquery.cookie.js" type="text/javascript"></script>

    
</head>
<body>
    
<style>
    .background-gray {
        background-color: #b5b5b5;
    }

    input::-webkit-inner-spin-button {
        -webkit-appearance: none;
    }

    input::-webkit-outer-spin-button {
        -webkit-appearance: none;
    }
</style>

<div id="header" class="header clearfix">
    <div class="header-list1">
        <span class="header-logo"><a href="http://www.360kad.com"><img src="https://res.360kad.com/theme/user/img/login_logo.jpg" /></a></span>
        <p class="header-notice"><img src="https://res.360kad.com/theme/default/img/user/2015/autoSlogo.gif" /></p>
    </div>
    <div class="header-list2">欢迎注册</div>
    <div class="header-list3">已有账号，<a href="login">立即登录></a></div>
</div>
<div style="background-color: blue; width: auto; height: 2px;"></div>
<div id="container" class="container-register">
    <h3 class="register-title">
        欢迎注册康爱多账号
    </h3>
    <div class="register-from">

        <div class="bind-input-wrap clearfix">
            <div class="bind-input">
                <p class="user-font">手<i class="phoneNum"></i>机<i class="phoneNum"></i>号<i class="phoneNum"></i>码</p>
                <input name="tianchongnimei" type="text" style="display:none" />
                <input name="tianchongnimei" maxlength="11" type="tel" class="user-name" name="" id="txtMobile" onkeyup="checkMobile($('#txtMobile'), 0)" onblur="checkMobile($('#txtMobile'),1);" value="" placeholder="请输入手机号码" autocomplete="off" />
                <input name="tianchongnimei" type="text" style="display:none" />
                <p class="yes-icon" style="display:none" id="mobileIcon"><i></i></p>
            </div>
            <p class="input-prompt bind-cont-prompt" style="display: none;" id="mobileErrorMsg">
                <i class="prompt-icon"></i>
                <span class="prompt-size">该手机号已存在，您可以直接使用该号码进行 <a href="javascript:void(0);" onclick="loginInPhone();"> 直接登录</a>！</span>
            </p>
        </div>
        <div class="bind-input-wrap clearfix">
            <div class="bind-input">
                <p class="user-font">密<i class="indentSize2"></i>码</p>
                <input name="tianchongnimei" maxlength="20" type="password" class="user-name" name="" id="txtPwd" value="" onkeyup="checkPwd($('#txtPwd'))" onblur="checkPwd($('#txtPwd'));" placeholder="请输入您的密码" />
                <p id="showPwd" class="yes-icon eye-icon"><i id="isShowPwd"></i></p>
            </div>
            <p class="input-prompt bind-cont-prompt" style="display: none;" id="pwdErrorMsg">
                <i class="prompt-icon"></i>
                <span class="prompt-size">请输入您的密码！</span>
            </p>
        </div>
        
        <div id="kad_web_aliacs_container" class="bind-input-wrap clearfix nc-container" style="margin-bottom:4px;"></div>
        <div class="bind-input-wrap clearfix">
            <div class="bind-code">
                <p class="user-font code-font">短信验证码</p>
                <input type="text" maxlength="6" class="code-name" name="" id="txtMobileCode" value="" onkeyup="checkMobileCode($('#txtMobileCode'))" onblur="checkMobileCode($('#txtMobileCode'));" placeholder="请输入短信验证码" />
            </div>
            <div id="getCode" class="code-email background-gray">点击获取短信验证码</div>
            <p class="input-prompt bind-cont-prompt" style="display: none;" id="mobileCodeErrorMsg">
                <i class="prompt-icon"></i>
                <span class="prompt-size">您输入的图形验证码有误！</span>
            </p>
        </div>
        <!--部件开始:user_register_agreement,分组:通用部件-->
<div class="register-agreement-box">
  <!-- 原来逻辑代码用到，不改了 -->
  <input class="Cinput" type="checkbox" checked="true" name="" id="kadText" value="" style="display: none;" />
  <div class="register-agreement-body">
    <!-- 标题 -->
    <div class="register-agreement-title">
      <div class="register-agreement-l">
        康爱多用户注册协议和隐私政策
      </div>
      <div class="register-agreement-r register-agreement-close">
        X
      </div>
    </div>
    <!-- 内容 -->
    <div class="register-agreement-content">
      <p>
        欢迎注册成为康爱多用户！在您注册成为康爱多用户的过程中，您需要完成我们的注册流程并通过点击同意的形式在线签署以下协议，
        <span class="register-agreement-underline">
          请您务必仔细阅读、充分理解协议中的条款内容后再点击同意（尤其是以粗体并下划线标识的条款，因为这些条款可能会明确您因履行的义务或对您的权利有所限制）：
        </span>
      </p>
      <p class="register-agreement-splh">
        《康爱多用户注册协议》
      </p>
      <p class="register-agreement-splh">《康爱多隐私政策》</p>
      <p class="register-agreement-underline">
        【请您注意】如果您不同意上述协议或其中任何条款约定，请您停止注册。您停止注册后将仅可以浏览我们的商品信息但无法享受我们的产品或服务。如您按照注册流程提示填写信息、阅读并点击同意上述协议且完成全部注册流程后，即表示您已充分阅读、理解并接受协议的全部内容；并表明您也同意康爱多可以依据以上的隐私政策内容来处理您的个人信息。如您对以上协议内容有任何疑问，您可随时与康爱多客服联系。
      </p>
      <p class="register-agreement-splh register-agreement-agree">
        点击同意即表示您已阅读并同意
        <a href="/help.360kad.com/Shopping/FuWuXieYi" target="_blank" class="register-agreement-link">《康爱多用户注册协议》</a>
        与
        <a href="/help.360kad.com/Shopping/YinSiShengMing" target="_blank" class="register-agreement-link">《康爱多隐私政策》</a>。
      </p>
    </div>
    <div class="register-agreement-btn">同意并继续</div>
  </div>
</div>

<style>
  .register-agreement-box {
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.2);
    height: 100%;
    width: 100%;
    z-index: 2019;
  }

  .register-agreement-body {
    background: #fff;
    width: 700px;
    height: 606px;
    line-height: 1.5;
    color: #333;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -350px;
    margin-top: -303px;
    border: 8px solid #6c6c6c;
  }

  .register-agreement-title {
    background: #f5f5f5;
    /* padding: 0 14px; */
    padding-left: 14px;
    position: relative;
    color: #323232;
    font-size: 20px;
    height: 46px;
    line-height: 46px;
  }

  .register-agreement-r {
    position: absolute;
    right: 0;
    top: 0;
    height: 46px;
    cursor: pointer;
    width: 46px;
    text-align: center;
    transform: scale(1.4, 1);
    color: #6c6c6c;
  }

  .register-agreement-content {
    padding: 20px 20px 0 20px;
    font-size: 16px;
    font-weight: 200;
    line-height: 30px;
  }

  .register-agreement-underline {
    text-decoration: underline;
    font-weight: 500;
    color: #323232;
  }

  .register-agreement-splh {
    line-height: 30px;
    margin: 20px 0;
  }

  .register-agreement-link {
    color: #409ffb;
  }
  .register-agreement-link:visited {
    color: #409ffb;
  }

  .register-agreement-btn {
    background: #409ffb;
    width: 153px;
    height: 38px;
    line-height: 36px;
    font-size: 16px;
    color: #fff;
    margin: 0 auto;
    text-align: center;
    cursor: pointer;
    opacity: 0.8;
    background: rgba(64, 159, 251, 1);
    border-radius: 6px;
  }

  .register-agreement-btn:hover {
    opacity: 1;
  }

  p.register-agreement-splh.register-agreement-agree {
    font-weight: 500;
    color: #323232;
  }
</style>
<script>
  $(function() {
    $('.register-agreement-close').click(function() {
      history.back();
    });
    $('.register-agreement-btn').click(function() {
      $('.register-agreement-box').hide();
    });
  });
</script>

<!--部件结束:user_register_agreement-->

        <a href="javascript:;" id="toLogin" class="login-btn background-gray">立即注册</a>
        <!--20160810add-->
        <div class="pay-type">
            <div class="payt-top">
                <p class="paytop-name">使用合作网站账号登录康爱多</p>
                <p class="paytop-line"></p>
            </div>
            <ul class="clearfix">
                <li class="ptype-wechat"><a title="微信登录" href="login/WeChatLogin?ReturnUrl=https%3a%2f%2fcart.360kad.com%2fCart%2f"></a></li>
                <li class="ptype-qq"><a title="QQ登录" href="login/QzoneLogin?ReturnUrl=https%3a%2f%2fcart.360kad.com%2fCart%2f"></a></li>
                
                <li class="ptype-zfb"><a title="支付宝登录" href="login/AlipayLogin?ReturnUrl=https%3a%2f%2fcart.360kad.com%2fCart%2f"></a></li>
                <li class="ptype-sina"><a title="新浪微博登录" href="login/SinaLogin?ReturnUrl=https%3a%2f%2fcart.360kad.com%2fCart%2f"></a></li>
                <li class="ptype-ykt"><a title="健保通（医卡通）登录" href="login/EbaolifeLogin?ReturnUrl=https%3a%2f%2fcart.360kad.com%2fCart%2f"></a></li>
            </ul>
        </div>
        <!--20160810add-->
    </div>
</div>
<div id="popup1" class="popup1" style="display: none;">
    <a href="javascript:;" onclick="$(this).parent().hide();" class="popup1-close"></a>
    <p class="popup1-title">账号确认</p>
    <div class="popup1-container">
        <p class="popup1-container-size">该手机号已存在，继续注册将与原来账号解除绑定，<a href="javascript:;"></a>您可使用原账号直接登录，或继续注册。</p>
    </div>
    <div class="popup1-btn">
        <a href="javascript:void(0);" onclick="loginInPhone();" class="btn1">直接登录</a>
    </div>
    <div class="popup1-link"><a href="javascript:void(0)" id="continueReg">没有注册过，继续注册></a></div>
</div>
<div id="popup2" class="popup1" style="display: none;">
    <a href="javascript:;" onclick="$(this).parent().hide();" class="popup1-close"></a>
    <p class="popup1-title">温馨提示</p>
    <div class="popup1-container">
        <p class="popup1-container-size">请阅读并同意《康爱多网上药店服务协议》！</p>
    </div>
    <div class="popup1-btn">
        <a href="javascript:void(0);" id="confirmLoginName" class="btn1">确定</a>
    </div>
</div>
<div id="popup8" class="popup1" style="display: none;">
    <a href="javascript:;" onclick="$(this).parent().hide();" class="popup1-close"></a>
    <p class="popup1-title">账号确认</p>
    <div class="popup1-container">
        <p class="popup1-container-size">该手机号已存在，继续注册将与原来账号解除绑定。<a href="javascript:;"></a></p>
    </div>
    <div class="popup1-btn">
        <a onclick="$('#popup8').hide();" href="javascript:void(0);" class="btn1">重新注册</a>
    </div>
</div>
<!--部件开始:www_low_ie_tips,分组:通用部件-->
<div id="low-ie-update-bg" style="display:none;">
  <div id="low-ie-update-mask"></div>
  <div id="low-ie-update-box">
    <div class="low-ie-update-header">
      <span class="low-ie-update-close" onclick="lowIeUpdateClose();"></span>
    </div>
    <div class="low-ie-update-tip">
      温馨提示：您当前的浏览器版本过低，存在安全风险，建议升级浏览器。
    </div>
    <div id="low-ie-update-browser">
      <a class="link-ie" href="https://www.microsoft.com/zh-cn/download/internet-explorer.aspx" target="_blank"></a>
      <a class="link-chrome" href="https://www.google.cn/chrome/browser" target="_blank"></a>
    </div>
    <div id="low-ie-update-qrcode"></div>
  </div>
</div>
<style>
#low-ie-update-bg{position:fixed;left:0;top:0;width:100%;height:100%;z-index:999;}#low-ie-update-mask{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000000;-moz-opacity:0.36;opacity:0.36;filter:alpha(opacity=36);z-index:999;overflow:hidden;}#low-ie-update-box{position:absolute;top:50%;left:50%;width:500px;height:470px;margin-left:-250px;margin-top:-235px;background-color:white;z-index:1000;}#low-ie-update-box .low-ie-update-header{width:100%;height:50px;background:#ffffff;}#low-ie-update-box .low-ie-update-close{width:50px;height:50px;float:right;background-image:url('https://res.360kad.com/script/AliyunAcs/low-ie/images/update-close.png');background-repeat:no-repeat;background-position:center;text-align:center;line-height:50px;cursor: pointer;}.low-ie-update-tip{width:100%;height:55px;line-height:55px;background-color:#ff8400;color:#ffffff;font-size:14px;text-indent:30px;}#low-ie-update-browser{width:100%;height:127px;background-image:url('https://res.360kad.com/script/AliyunAcs/low-ie/images/update-browser.jpg');background-repeat:no-repeat;background-position:center;}#low-ie-update-browser .link-ie{width:50%;height:100%;float:left;}#low-ie-update-browser .link-chrome{width:50%;height:100%;float:right;}#low-ie-update-qrcode{width:100%;height:236px;background-image:url('https://res.360kad.com/script/AliyunAcs/low-ie/images/update-qrcode.jpg');background-repeat:no-repeat;background-position:center;}
</style>
<script>
    $(function () {
      if (isLowIE()) {
        $('#low-ie-update-bg').show();
      }
    });

    function lowIeUpdateClose() {
      $('#low-ie-update-bg').remove();
    }

    function isLowIE() {
      var b = navigator.userAgent.toLowerCase()
      var c = b.match(/msie ([\d.]+)/)
      if (c) {
        var ie = c[1]
        return '6.0' === ie || '7.0' === ie || '8.0' === ie
      }
      return false
    }
</script>
<!--部件结束:www_low_ie_tips-->


    <!--部件开始:footer_userlogin2016,分组:页脚部件-->
<style>
#kad{ color:#666; } 
#footer a:hover {color: red}
}
</style>
<div id="footer" class="footer">
			<div class="footer-container">
				<p class="footer-about">
                                       <a rel="nofollow" href="http://www.360kad.com/zhuanti/pc_pifa.shtml" target="_blank" class="pifa_shop">批发招商<span></span></a> |
					<a rel="nofollow" href="http://help.360kad.com/about/kankan" target="_blank">关于我们</a> | <a href="http://www.360kad.com/zhuanti/kad_zsyd.shtml" target="_blank" rel="nofollow">
						    掌上药店
						</a> | <a rel="nofollow" href="http://help.360kad.com/about/entitygz" target="_blank">
						    实体药店
						</a> | <a rel="nofollow" href="http://help.360kad.com/About/Recruitment" target="_blank">加入康爱多</a> | <a href="http://help.360kad.com/About/CallUs" target="_blank" rel="nofollow">联系我们</a> | <a href="http://www.360kad.com/Supplier" target="_blank" rel="nofollow">商务合作</a>	| <a href="http://help.360kad.com/About/Authen" rel="nofollow" target="_blank">经营认证</a> | 
<a rel="nofollow" href="/help.360kad.com/Shopping/YinSiShengMing" target="_blank">隐私政策</a> |
<a rel="nofollow" href="http://help.360kad.com/About/FriendlyLink" target="_blank">友情链接</a> | <a href="http://www.360kad.com/TagList.aspx" target="_blank">
						    TAG列表
						</a> | <a href="http://www.360kad.com/SiteMap.shtml" target="_blank">网站地图</a> | <a href="http://cps.360kad.com/" target="_blank">CPS联盟</a>
				</p>
				<p class="footer-about">
		            <a class="pr8" rel="nofollow" title="互联网药品交易服务资格证书" target="_blank" href="http://help.360kad.com/about/AuthenBusiness">
		                互联网药品交易服务资格证书
		            </a>| <span class="bottomPadding01">
		                      <a rel="nofollow" title="互联网药品信息服务资格证书" target="_blank" href="http://help.360kad.com/About/AuthenInfo">
		                          互联网药品信息服务资格证书
		                      </a>
		            </span>| <span class="bottomPadding01">
		                         <a rel="nofollow" title="执业药师证" target="_blank" href="http://help.360kad.com/About/AuthenManage">执业药师证</a>
		            </span>| <span class="bottomPadding02">
		                         <a rel="nofollow" title="药品经营许可证" target="_blank" href="http://help.360kad.com/About/AuthenManage">药品经营许可证</a>
		            </span>| <span class="bottomPadding02">
		                         <a rel="nofollow" title="食品流通许可证" target="_blank" href="http://help.360kad.com/About/AuthenLiuTong">
		                             食品流通许可证
		                         </a>
		            </span>| <span class="bottomPadding02">
		                         <a rel="nofollow" title="公司营业执照" target="_blank" href="http://help.360kad.com/About/Authen">公司营业执照</a>
		            </span>| <span>
		                         <a rel="nofollow" title="GSP认证证书" target="_blank" href="http://help.360kad.com/About/AuthenGSP">
		                             GSP认证证书
		                         </a>
		            </span>| <span>
		                         <a href="http://help.360kad.com/About/AuthenTeleservice" target="_blank" rel="nofollow">增值电信业务经营许可证 &nbsp;</a>
		            </span>
		        </p>
		        
<p style="width:350px;margin:0 auto;color:#666;" class="bottom">&copy;2010-2016 广东<a id="kad"  href="http://www.360kad.com">康爱多网上药店</a>版权所有，并保留所有权利</p>
			</div>
		</div>
    <!--百度统计  start -->
    <div style="display: none;">
        <script type="text/javascript">
            var _bdhmProtocol = " https://";
            document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F9dc25c72b2848d6257aafcf33ec1a6db' type='text/javascript'%3E%3C/script%3E"));
        </script>
        
        <!-- 谷歌统计 start -->
        <script type="text/javascript">            var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-3051632-5']); _gaq.push(['_setDomainName', '']); _gaq.push(['_setAllowHash', false]); _gaq.push(['_addOrganic', 'soso', 'w']); _gaq.push(['_addOrganic', 'youdao', 'q']); _gaq.push(['_addOrganic', 'sogou', 'query']); _gaq.push(['_trackPageview']); (function () { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();</script>
    </div>
<!--部件结束:footer_userlogin2016-->

</body>
</html>

    <script id="kad_web_aliacs_js" type="text/javascript" charset="utf-8" src="https://g.alicdn.com/sd/ncpc/nc.js?t=2020011115"></script>
    <script src="https://res.360kad.com/script/AliyunAcs/app.js" type="text/javascript"></script>
    <script type="text/javascript">
        //数据存储
        var configData = {
            aliAcsHelper: null,
            aliVCodeKey: ''
        };

        String.prototype.len = function () // 给string增加个len ()方法，计算string的字节数 然后val().len()就行了
        {
            return this.replace(/[^\x00-\xff]/g, "xx").length;
        }

        //验证手机号码
        function phonereg(phoneNum) {
            var myreg = /^((13|15|17|18|14|16|19)[0-9]{1})+\d{8}$/;
            return myreg.test(phoneNum);
        }

        ///跳转到登录页 带上手机号码
        function loginInPhone() {
            var mobile = $("#txtMobile").val();
            window.location.href = "login?ReturnUrl=http://user.360kad.com/user&phone=" + mobile;
        }

        $(function () {
            BindTime();
            BindEvent();
            $(".bind-nav ul li").click(function () {
                var index = $(this).index();
                $(this).addClass('cur').siblings().removeClass('cur');
                $(".bind-cont").eq(index).show().siblings('.bind-cont').hide();
            });



            $("#showPwd").click(function () {
                var val = $(this).prev().val();
                var str = "onkeyup=\"checkPwd($('#txtPwd'))\" onblur=\"checkPwd($('#txtPwd'));\"";
                if ($("#isShowPwd").hasClass('open')) {
                    $("#isShowPwd").removeClass('open');
                    $(this).prev().replaceWith('<input maxlength=20 type="password" class="user-name" name="" id="txtPwd" value="' + val + '" placeholder="请输入您的密码" ' + str + ' />');
                } else {
                    $("#isShowPwd").addClass('open');
                    $(this).prev().replaceWith('<input maxlength=20 type="text" class="user-name" name="" id="txtPwd" value="' + val + '" placeholder="请输入您的密码" ' + str + '>');
                }
            });
            $(".radio-list i").click(function () {
                $(".radio-list i").removeClass('checked');
                $(this).addClass('checked');
            });

            $(document).on("keyup click", ".bind-input-wrap input,#kadText", validateInput);

            function validateInput() {
                //var loginName = $("#txtUserName").val();//用户名
                var phoneNum = $("#txtMobile").val();//手机号码
                var password = $("#txtPwd").val();//密码
                //var graphCode = $("#txtImgCode").val();//图形验证码
                var phoneCode = $("#txtMobileCode").val();//手机验证码
                var kadText = $("#kadText").val();//康爱多网上药店服务协议
                //if (phoneNum.length == 11 && graphCode.length == 4) {
                if (phoneNum.length == 11 && configData.aliVCodeKey !== '') {
                    $("#getCode").removeClass("background-gray");
                }
                else {
                    $("#getCode").addClass("background-gray");
                }
                //if ($("#kadText").attr("checked") == "checked" && phoneNum.length == 11 && (password.length >= 6 && password.length <= 20) && graphCode.length == 4 && phoneCode.length == 6) {
                if ($("#kadText").attr("checked") == "checked" && phoneNum.length == 11 && (password.length >= 6 && password.length <= 20) && configData.aliVCodeKey !== '' && phoneCode.length == 6) {
                    $("#toLogin").removeClass("background-gray");
                }
                else {
                    $("#toLogin").addClass("background-gray");
                }
            }

            var lastTime = $.cookie("kadSendPhoneCodeTime");
            var wait = 0;
            function time() {
                if (wait == 0) {
                    $.cookie("kadSendPhoneCodeTime", null, { expires: 1, domain: '360kad.com', path: '' });
                    $("#getCode").removeClass('stop');
                    $("#getCode").html("重新发送验证码");
                    wait = 60;
                    BindEvent();
                }
                else {
                    $("#getCode").unbind("click");
                    $("#getCode").addClass('stop');
                    $("#getCode").html("重新发送(" + wait + ")");
                    wait--;
                    setTimeout(function () {
                        time()
                    },
                    1000)
                }
            };
            function BindEvent() {
                $("#getCode").unbind("click").click(function () {
                    if ($("#getCode").hasClass("background-gray")) {
                        return;
                    }
                    $("#getCode").addClass("background-gray");
                    var mobile = $("#txtMobile").val();
                    if (mobile == "") {
                        $('#mobileIcon').hide();
                        $("#mobileErrorMsg").show();
                        $('#mobileErrorMsg span').html("请输入手机号码!");
                        return;
                    }
                    var vCode = configData.aliVCodeKey;//$("#txtImgCode").val();
                    if (vCode == "") {
                        reloadAliVCode('请先通过人机验证')
                        //$("#imgCodeErrorMsg").show();
                        //$('#imgCodeErrorMsg span').html("请输入图形验证码");
                        return;
                    }
                    var _this = $(this);
                    if (_this.hasClass('stop'))
                        return;
                    var startTime = Date();
                    $.ajax({
                        url: 'Register/GetSms',
                        data: 'mobile=' + encodeURIComponent(mobile) + '&vCode=' + vCode,
                        type: "post",
                        cache: false,
                        dataType: "json",
                        success: function (data) {
                            $("#getCode").removeClass("background-gray");
                            if (data.Result) {
                                $.cookie("kadSendPhoneCodeTime", startTime, { expires: 1, domain: '360kad.com', path: '' });
                                wait = 60;
                                time();
                                $("#mobileCodeErrorMsg").hide();
                            }
                            else {
                                if (data.Code === 'vCodeErr') {
                                    reloadAliVCode(data.Message);
                                } else {
                                    reloadAliVCode();
                                }
                                if (data.Message == "您输入的手机格式不正确！" || data.Message == "您输入的手机号码已存在！") {
                                    if (data.Message == "您输入的手机号码已存在！") {
                                        $('#mobileErrorMsg span').html("该手机号已存在，您可以直接使用该号码进行 <a href='login?ReturnUrl=http://user.360kad.com/login?ReturnUrl=https://cart.360kad.com/Cart/&phone=" + mobile + "' style='color:#409ffb' >直接登录</a>")
                                        $("#mobileErrorMsg").show();
                                        return;
                                    }
                                    $("#mobileErrorMsg").show();
                                    $('#mobileErrorMsg span').html(data.Message);
                                }
                                    //else if (data.Message == "图形验证码已过期" || data.Message == "您输入的图形验证码有误") {
                                    //    $("#getGraphCode").click();
                                    //    $("#txtImgCode").val("");
                                    //    $("#txtImgCode").focus();
                                    //    $("#imgCodeErrorMsg").show();
                                    //    $('#imgCodeErrorMsg span').html(data.Message);
                                    //}
                                else {
                                    $("#mobileCodeErrorMsg").show();
                                    $('#mobileCodeErrorMsg span').html(data.Message);
                                }
                            }
                        }
                    });
                });
            };


            function BindTime() {
                if (lastTime != null) {
                    if (GetDateDiff(lastTime, Date(), "second") > 60) {
                        $.cookie("kadSendPhoneCodeTime", null, { expires: 1, domain: '360kad.com', path: '' });
                    }
                    else {
                        wait = 60 - GetDateDiff(lastTime, Date(), "second");
                        time();
                    }
                }
            }

            var isRegister = true;
            $("#toLogin").click(function () {
                if ($("#toLogin").hasClass("background-gray")) {
                    return;
                }
                if (!$('.Cinput').attr('checked')) {
                    $("#popup2").show();
                    $("#confirmLoginName").unbind().click(function () {
                        $("#popup2").hide();
                    });
                    return;
                }
                //if (!checkUserName($("#txtUserName"), 2)) return;
                if (!checkMobile($("#txtMobile"), 2)) return;
                if (!checkPwd($("#txtPwd"))) return;
                //if (!checkImgCode($("#txtImgCode"))) return;
                if (!checkMobileCode($("#txtMobileCode"))) return;
                if (!isRegister) {
                    return;
                }
                isRegister = false;
                //var userName = $("#txtUserName").val();
                $.ajax({
                    url: "Register/RegisterUser",
                    data: { mobile: $("#txtMobile").val(), password: $("#txtPwd").val(), imgCode: $("#txtImgCode").val(), vcode: $("#txtMobileCode").val(), loginPlatform: '1' },
                    dataType: "json",
                    type: "post",
                    async: false,
                    cache: false,
                    success: function (data) {
                        if (!data.Result) {
                            if (data.Code == 2) {
                                $("#mobileErrorMsg").show();
                                $('#mobileErrorMsg span').html(data.Message);
                            }
                            else if (data.Code == 3) {
                                $("#pwdErrorMsg").show();
                                $('#pwdErrorMsg span').html(data.Message);
                            }
                            else if (data.Code == 4) {
                                $("#imgCodeErrorMsg").show();
                                $('#imgCodeErrorMsg span').html(data.Message);
                            }
                            else if (data.Code == 5) {
                                $("#mobileCodeErrorMsg").show();
                                $('#mobileCodeErrorMsg span').html(data.Message);
                            }
                            else {
                                alert(data.Message);
                            }
                            isRegister = true;
                            return;
                        }
                        else {
                            location.href = "https://cart.360kad.com/Cart/";
                        }

                    },
                    error: function (data) {
                        alert("未知错误");
                        isRegister = true;
                    }
                });
            });
            //没有注册过，继续注册
            $("#continueReg").click(function () {
                $("#popup1").hide();
                $('#mobileIcon').show();
                $("#mobileErrorMsg").hide();
            });

            //初始阿里人机验证
            initAliVCode();
            //初始阿里人机验证
            function initAliVCode() {
                configData.aliAcsHelper = new AliAcsHelper();
                configData.aliAcsHelper.init(null, function (aliVCodeKey) {
                    configData.aliVCodeKey = aliVCodeKey;
                    validateInput();
                });
            }
            //重置验证
            function reloadAliVCode(tips) {
                configData.aliVCodeKey = '';
                configData.aliAcsHelper.reload(tips);
            }
        });

        function validate_password(field, alerttxt) {
            with (field) {
                var Regx = /(^[A-Za-z0-9]$)/;
                if (Regx.test(obj.value) == false)
                { alert(alerttxt); return false }
                else { return true }
            }
        }

        //验证手机号
        function checkMobile(o, type) {
            o.val(o.val().replace(/\D/g, ''));
            var mobile = o.attr("value");
            if (type == 0) {
                $('#mobileIcon').hide();
                return false;
            }
            if (mobile == '') {
                $('#mobileIcon').hide();
                $("#mobileErrorMsg").show();
                $('#mobileErrorMsg span').html("请输入手机号码!");
                return false;
            }
            else {
                $("#mobileErrorMsg").hide();
            }
            if (mobile.length != 11) {
                $('#mobileIcon').hide();
                $("#mobileErrorMsg").show();
                $('#mobileErrorMsg span').html("手机号码长度不正确!");
                return false;
            }
            else {
                $('#mobileIcon').show();
                $("#mobileErrorMsg").hide();
            }
            if (!phonereg(mobile)) {
                $('#mobileIcon').hide();
                $("#mobileErrorMsg").show();
                $('#mobileErrorMsg span').html("手机号码格式不正确!");
                return;
            }
            else {
                $('#mobileIcon').show();
                $("#mobileErrorMsg").hide();
            }
            if (type == 2) return true;
            var result = false;
            $.ajax({
                url: "Register/IsExisteMobile?mobile=" + mobile,
                type: "post",
                cache: false,
                async: false,
                dataType: "json",
                success: function (data) {
                    if (!data.Result) {
                        if (data.Message == "手机号码已存在") {
                            $('#mobileIcon').hide();
                            $("#mobileErrorMsg").show();
                            $('#mobileErrorMsg span').html("该手机号已存在，您可以直接使用该号码进行 <a href='login?ReturnUrl=http://user.360kad.com/login?ReturnUrl=https://cart.360kad.com/Cart/&phone=" + mobile + "' style='color:#409ffb' >直接登录</a>")
                            result = false;
                        }
                    }
                    else {
                        if (data.Message == "注册解绑" || data.Message == "第三方注册") {
                            $("#popup1").show();
                            $('#mobileIcon').hide();
                            result = false;
                        }
                        else {
                            $('#mobileIcon').show();
                            $("#mobileErrorMsg").hide();
                            result = true;
                        }
                    }
                }
            });
            return result;
        }

        //验证手机验证码
        function checkMobileCode(obj) {
            var mobileCode = obj.attr("value");
            if (mobileCode == '') {
                $("#mobileCodeErrorMsg").show();
                $('#mobileCodeErrorMsg span').html("请输入手机验证码");
                return false;
            }
            $("#mobileCodeErrorMsg").hide();
            return true;
        }
        //验证图形验证码
        function checkImgCode(obj) {
            var imgCode = obj.attr("value");
            if (imgCode.length != 4) {
                return;
            }

            var result = false;
            $.ajax({
                url: "Register/CheckVCode?validateCode=" + imgCode,
                dataType: "json",
                type: "get",
                async: false,
                cache: false,
                success: function (data) {
                    if (!data.Result) {
                        $("#imgCodeErrorMsg").show();
                        $('#imgCodeErrorMsg span').html(data.Message);
                        result = false;
                    }
                    else {
                        $("#imgCodeErrorMsg").hide();
                        result = true;
                    }
                }
            });
            return result;
        }
        //验证密码
        function checkPwd(obj) {
            var pwd = obj.attr("value");
            if (pwd == '') {
                $("#pwdErrorMsg").show();
                $('#pwdErrorMsg span').html("请输入密码");
                return false;
            }
            if (pwd.length < 6) {
                $("#pwdErrorMsg").show();
                $('#pwdErrorMsg span').html("密码长度必须大于6位数");
                return false;
            }
            if (!isPasswd(pwd)) {
                $("#pwdErrorMsg").show();
                $('#pwdErrorMsg span').html("只能输入6-20个字母、数字、下划线");
                return false;
            }
            $("#pwdErrorMsg").hide();
            return true;
        }

        //验证密码格式
        function isPasswd(s) {
            var patrn = /^(\w){6,20}$/;
            if (!patrn.exec(s)) return false
            return true
        }
    </script>

